package Nio;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author jou
 */
public class IoServer {
    static int port = 11080;
    static byte[] bs = new byte[1024];
    public static void main(String[] args) throws IOException {
        try (ServerSocket serverSocket = new ServerSocket(port)) {
            while (true) {
                Socket clientSocket = serverSocket.accept();
                clientSocket.getInputStream().read(bs);

                System.out.printf("%s\n", new String(bs));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}